package haxibiao

func canConstruct(ransomNote string, magazine string) bool {
	hash := map[int32]int{}
	for _, x := range ransomNote {
		hash[x]++
	}
	for _, x := range magazine {
		if hash[x] > 0 {
			hash[x]--
		}
	}
	for _, v := range hash {
		if v > 0 {
			return false
		}
	}
	return true
}
